home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / gfx / vtdevel3.lha / Include / devices / hardblocks.i < prev    next >
Text File  |  1992-09-24  |  9KB  |  204 lines

  1.     IFND    DEVICES_HARDBLOCKS_I
  2. DEVICES_HARDBLOCKS_I    SET    1
  3. **
  4. **    $VER: hardblocks.i 36.3 (23.08.91)
  5. **    Includes Release 39.108
  6. **
  7. **    File System identifier blocks for hard disks
  8. **
  9. **    (C) Copyright 1988-1992 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND    EXEC_TYPES_I
  14.     INCLUDE    "exec/types.i"
  15.     ENDC
  16.  
  17.  
  18. ;---------------------------------------------------------------------
  19. ;
  20. ;    This file describes blocks of data that exist on a hard disk
  21. ;    to describe that disk.    They are not generically accessable to
  22. ;    the user as they do not appear on any DOS drive.  The blocks
  23. ;    are tagged with a unique identifier, checksummed, and linked
  24. ;    together.  The root of these blocks is the RigidDiskBlock.
  25. ;
  26. ;    The RigidDiskBlock must exist on the disk within the first
  27. ;    RDB_LOCATION_LIMIT blocks.  This inhibits the use of the zero
  28. ;    cylinder in an AmigaDOS partition: although it is strictly
  29. ;    possible to store the RigidDiskBlock data in the reserved
  30. ;    area of a partition, this practice is discouraged since the
  31. ;    reserved blocks of a partition are overwritten by "Format",
  32. ;    "Install", "DiskCopy", etc.  The recommended disk layout,
  33. ;    then, is to use the first cylinder(s) to store all the drive
  34. ;    data specified by these blocks: i.e. partition descriptions,
  35. ;    file system load images, drive bad block maps, spare blocks,
  36. ;    etc.
  37. ;
  38. ;    Though only 512 byte blocks are currently supported by the
  39. ;    file system, this proposal tries to be forward-looking by
  40. ;    making the block size explicit, and by using only the first
  41. ;    256 bytes for all blocks but the LoadSeg data.
  42. ;
  43. ;---------------------------------------------------------------------
  44.  
  45. ;
  46. ;   NOTE
  47. ;    optional block addresses below contain $ffffffff to indicate
  48. ;    a NULL address
  49. ;
  50.  STRUCTURE    RigidDiskBlock,0
  51.     ULONG   rdb_ID        ; 4 character identifier
  52.     ULONG   rdb_SummedLongs    ; size of this checksummed structure
  53.     LONG    rdb_ChkSum        ; block checksum (longword sum to zero)
  54.     ULONG   rdb_HostID        ; SCSI Target ID of host
  55.     ULONG   rdb_BlockBytes    ; size of disk blocks
  56.     ULONG   rdb_Flags        ; see below for defines
  57.     ; block list heads
  58.     ULONG   rdb_BadBlockList    ; optional bad block list
  59.     ULONG   rdb_PartitionList    ; optional first partition block
  60.     ULONG   rdb_FileSysHeaderList ; optional fule system header block
  61.     ULONG   rdb_DriveInit    ; optional drive-specific init code
  62.                 ; DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1
  63.     STRUCT  rdb_Reserved1,6*4    ; set to $ffffffff
  64.     ; physical drive characteristics
  65.     ULONG   rdb_Cylinders    ; number of drive cylinders
  66.     ULONG   rdb_Sectors        ; sectors per track
  67.     ULONG   rdb_Heads        ; number of drive heads
  68.     ULONG   rdb_Interleave    ; interleave
  69.     ULONG   rdb_Park        ; landing zone cylinder
  70.     STRUCT  rdb_Reserved2,3*4
  71.     ULONG   rdb_WritePreComp    ; starting cylinder: write precompensation
  72.     ULONG   rdb_ReducedWrite    ; starting cylinder: reduced write current
  73.     ULONG   rdb_StepRate    ; drive step rate
  74.     STRUCT  rdb_Reserved3,5*4
  75.     ; logical drive characteristics
  76.     ULONG   rdb_RDBBlocksLo    ; low block of range reserved for hardblocks
  77.     ULONG   rdb_RDBBlocksHi    ; high block of range for these hardblocks
  78.     ULONG   rdb_LoCylinder    ; low cylinder of partitionable disk area
  79.     ULONG   rdb_HiCylinder    ; high cylinder of partitionable data area
  80.     ULONG   rdb_CylBlocks    ; number of blocks available per cylinder
  81.     ULONG   rdb_AutoParkSeconds    ; zero for no auto park
  82.     ULONG   rdb_HighRDSKBlock    ; highest block used by RDSK
  83.                 ; (not including replacement bad blocks)
  84.     STRUCT  rdb_Reserved4,1*4
  85.     ; drive identification
  86.     STRUCT  rdb_DiskVendor,8
  87.     STRUCT  rdb_DiskProduct,16
  88.     STRUCT  rdb_DiskRevision,4
  89.     STRUCT  rdb_ControllerVendor,8
  90.     STRUCT  rdb_ControllerProduct,16
  91.     STRUCT  rdb_ControllerRevision,4
  92.     STRUCT  rdb_Reserved5,10*4
  93.  
  94.     LABEL   RigidDiskBlock_SIZEOF
  95.  
  96. IDNAME_RIGIDDISK    EQU    (('R'<<24)!('D'<<16)!('S'<<8)!('K'))
  97.  
  98. RDB_LOCATION_LIMIT    EQU    16
  99.  
  100.     BITDEF  RDBF,LAST,0        ; no disks exist to be configured after
  101.                 ;   this one on this controller
  102.     BITDEF  RDBF,LASTLUN,1    ; no LUNs exist to be configured greater
  103.                 ;   than this one at this SCSI Target ID
  104.     BITDEF  RDBF,LASTTID,2    ; no Target IDs exist to be configured
  105.                 ;   greater than this one on this SCSI bus
  106.     BITDEF  RDBF,NORESELECT,3    ; don't bother trying to perform reselection
  107.                 ;   when talking to this drive
  108.     BITDEF  RDBF,DISKID,4    ; rdb_Disk... identification valid
  109.     BITDEF  RDBF,CTRLRID,5    ; rdb_Controller... identification valid
  110.                 ; added 7/20/89 by commodore:
  111.     BITDEF  RDBF,SYNCH,6    ; drive supports scsi synchronous mode
  112.                 ; CAN BE DANGEROUS TO USE IF IT DOESN'T!
  113.  
  114. ;---------------------------------------------------------------------
  115.  STRUCTURE    BadBlockEntry,0
  116.     ULONG   bbe_BadBlock    ; block number of bad block
  117.     ULONG   bbe_GoodBlock    ; block number of replacement block
  118.     LABEL   BadBlockEntry_SIZEOF
  119.  
  120.  STRUCTURE    BadBlockBlock,0
  121.     ULONG   bbb_ID        ; 4 character identifier
  122.     ULONG   bbb_SummedLongs    ; size of this checksummed structure
  123.     LONG    bbb_ChkSum        ; block checksum (longword sum to zero)
  124.     ULONG   bbb_HostID        ; SCSI Target ID of host
  125.     ULONG   bbb_Next        ; block number of the next BadBlockBlock
  126.     ULONG   bbb_Reserved
  127.     STRUCT  bbb_BlockPairs,61*BadBlockEntry_SIZEOF ; bad block entry pairs
  128.     ; note 61 assumes 512 byte blocks
  129.     ; there is no BadBlockBlock_SIZEOF: try rdb_BlockBytes
  130.  
  131. IDNAME_BADBLOCK        EQU    (('B'<<24)!('A'<<16)!('D'<<8)!('B'))
  132.  
  133. ;---------------------------------------------------------------------
  134.  STRUCTURE    PartitionBlock,0
  135.     ULONG   pb_ID        ; 4 character identifier
  136.     ULONG   pb_SummedLongs    ; size of this checksummed structure
  137.     LONG    pb_ChkSum        ; block checksum (longword sum to zero)
  138.     ULONG   pb_HostID        ; SCSI Target ID of host
  139.     ULONG   pb_Next        ; block number of the next PartitionBlock
  140.     ULONG   pb_Flags        ; see below for defines
  141.     STRUCT  pb_Reserved1,2*4
  142.     ULONG   pb_DevFlags        ; preferred flags for OpenDevice
  143.     STRUCT  pb_DriveName,32    ; preferred DOS device name: BSTR form
  144.                 ; (not used if this name is in use)
  145.     STRUCT  pb_Reserved2,15*4    ; filler to 32 longwords
  146.     STRUCT  pb_Environment,17*4    ; environment vector for this partition
  147.     STRUCT  pb_EReserved,15*4    ; reserved for future environment vector
  148.     LABEL   PartitionBlock_SIZEOF
  149.  
  150. IDNAME_PARTITION    EQU    (('P'<<24)!('A'<<16)!('R'<<8)!('T'))
  151.  
  152.     BITDEF  PBF,BOOTABLE,0    ; this partition is intended to be bootable
  153.                 ;   (expected directories and files exist)
  154.     BITDEF  PBF,NOMOUNT,1    ; do not mount this partition (e.g. manually
  155.                 ;   mounted, but space reserved here)
  156.  
  157. ;---------------------------------------------------------------------
  158.  STRUCTURE    FileSysHeaderBlock,0
  159.     ULONG   fhb_ID        ; 4 character identifier
  160.     ULONG   fhb_SummedLongs    ; size of this checksummed structure
  161.     LONG    fhb_ChkSum        ; block checksum (longword sum to zero)
  162.     ULONG   fhb_HostID        ; SCSI Target ID of host
  163.     ULONG   fhb_Next        ; block number of the next FileSysHeaderBlock
  164.     ULONG   fhb_Flags        ; see below for defines
  165.     STRUCT  fhb_Reserved1,2*4
  166.     ULONG   fhb_DosType        ; file system description: match this with
  167.                 ; partition environment's DE_DOSTYPE entry 
  168.     ULONG   fhb_Version        ; release version of this code
  169.     ULONG   fhb_PatchFlags    ; bits set for those of the following that
  170.                 ;   need to be substituted into a standard
  171.                 ;   device node for this file system: e.g.
  172.                 ;   $180 to substitute SegList & GlobalVec
  173.     ULONG   fhb_Type        ; device node type: zero
  174.     ULONG   fhb_Task        ; standard dos "task" field: zero
  175.     ULONG   fhb_Lock        ; not used for devices: zero
  176.     ULONG   fhb_Handler        ; filename to loadseg: zero placeholder
  177.     ULONG   fhb_StackSize    ; stacksize to use when starting task
  178.     LONG    fhb_Priority    ; task priority when starting task
  179.     LONG    fhb_Startup        ; startup msg: zero placeholder
  180.     LONG    fhb_SegListBlocks    ; first of linked list of LoadSegBlocks:
  181.                 ;   note that this entry requires some
  182.                 ;   processing before substitution
  183.     LONG    fhb_GlobalVec    ; BCPL global vector when starting task
  184.     STRUCT  fhb_Reserved2,23*4    ; (those reserved by PatchFlags)
  185.     STRUCT  fhb_Reserved3,21*4
  186.     LABEL   FileSysHeader_SIZEOF
  187.  
  188. IDNAME_FILESYSHEADER    EQU    (('F'<<24)!('S'<<16)!('H'<<8)!('D'))
  189.  
  190. ;---------------------------------------------------------------------
  191.  STRUCTURE    LoadSegBlock,0
  192.     ULONG   lsb_ID        ; 4 character identifier
  193.     ULONG   lsb_SummedLongs    ; size of this checksummed structure
  194.     LONG    lsb_ChkSum        ; block checksum (longword sum to zero)
  195.     ULONG   lsb_HostID        ; SCSI Target ID of host
  196.     ULONG   lsb_Next        ; block number of the next FileSysBlock
  197.     STRUCT  lsb_LoadData,123*4    ; data for "loadseg"
  198.     ; note 123 assumes 512 byte blocks
  199.     ; there is no LoadSegBlock_SIZEOF: try rdb_BlockBytes
  200.  
  201. IDNAME_LOADSEG        EQU    (('L'<<24)!('S'<<16)!('E'<<8)!('G'))
  202.  
  203.     ENDC
  204.